/**
 * @author xuyh0817
 * @email xuyh0817@foxmail.com
 * @date 2022-02-22 01:22
 * @version 2.0.0
 * @doc todo
 * @website todo
 * @remark  如果要分发源码，需在本文件顶部保留此文件头信息！！
 */

import {COMPONENT_TYPE} from '../../../../../libs/constants'

export default [
  {
    id: '1',
    type: COMPONENT_TYPE.SELECT,
    formItem: {
      prop: 'type',
      rules: [],
      label: '类型',
      extra: '属性类型 string|number|boolean|integer|float|url|email|hex',
    },
    attrs: {
      value: 'string',
      children: [
        {
          value: 'string',
          label: 'string'
        },
        {
          value: 'number',
          label: 'number'
        },
        {
          value: 'boolean',
          label: 'boolean'
        },
        {
          value: 'integer',
          label: '整数'
        },
        {
          value: 'float',
          label: '浮点数'
        },
        {
          value: 'url',
          label: 'url地址'
        },
        {
          value: 'email',
          label: 'email地址'
        },
        {
          value: 'hex',
          label: '16进制'
        }
      ]
    }
  },
  {
    id: '2',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'trigger',
      rules: [],
      label: '触发方式',
      extra: '校验触发的时机 blur| change | change,blur',
    },
    attrs: {
      value: 'blur',
      buttonStyle: 'solid',
      children: [
        {
          value: 'blur',
          label: 'blur'
        },
        {
          value: 'change',
          label: 'change'
        },
        {
          value: 'change,blur',
          label: 'change,blur'
        }
      ]
    }
  },
  {
    id: '3',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'pattern',
      rules: [],
      label: '正则表达式',
    },
    attrs: {
      maxLength: 1000,
      type: 'text',
      allowClear: true,
      placeholder: '请输入正则表达式'
    }
  },
  {
    id: '4',
    type: COMPONENT_TYPE.INPUT_NUMBER,
    formItem: {
      prop: 'max',
      rules: [],
      label: '最大长度',
    },
    attrs: {
      value: '',
      max: 9999,
      min: -9999,
      placeholder: '请输入最大长度'
    }
  },
  {
    id: '5',
    type: COMPONENT_TYPE.INPUT_NUMBER,
    formItem: {
      prop: 'min',
      rules: [],
      label: '最小长度',
    },
    attrs: {
      value: '',
      max: 9999,
      min: -9999,
      placeholder: '请输入最小长度'
    }
  },
  {
    id: '6',
    type: COMPONENT_TYPE.INPUT_NUMBER,
    formItem: {
      prop: 'len',
      rules: [],
      label: '字段长度',
    },
    attrs: {
      value: '',
      max: 9999,
      min: -9999,
      placeholder: '请输入字段长度'
    }
  },
  {
    id: '7',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'message',
      rules: [],
      label: '提示信息',
    },
    attrs: {
      maxLength: 1000,
      type: 'text',
      allowClear: true,
      placeholder: '请输入提示信息'
    }
  },
  {
    id: '8',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'validator',
      rules: [],
      label: '自定义校验',
      extra: '自定义校验（注意，callback 必须被调用）function(rule, value, callback)',
    },
    attrs: {
      maxLength: 1000,
      type: 'text',
      allowClear: true,
      placeholder: '请输入自定义校验方法名称'
    }
  }
]

